
using System;
using System.Drawing;

using Game.Main;
using Game.Properties;

namespace Game
{
    public enum EngineRunners
    {
        OpenTK,
        Axiom
    }

	public class AppMain :IDisposable
	{
        IEngineSystem system;


		public AppMain ()
		{
			Logging.Logger.InitLogger();

            string systemType = Settings.Default.EngineSystem;

            switch (systemType)
            {
                case "OpenTK":
                    //this.system = new OpenTKSystem();
                    break;
                case "Axiom":
                    this.system = new AxiomSystem();
                    break;
                default:
                    Logging.Logger.AddError("Unkonwn engine system " + systemType);
                    return;
            }

            this.system.Init();
            this.system.Start();
        }
		
		/// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            using (AppMain app = new AppMain())
            {
                //app.Run(30.0, 60.0);
				//app.Run();
            }
        }

        #region IDisposable Members

        public void Dispose()
        {
            if (this.system != null)
            {
                this.system.Quit(); 
            }
        }

        #endregion
    }
	
}
